from likeshop_api_project.base.mybase import Tools

class getGoodsList_model(Tools):
    # 路径
    path = 'api/goods/getGoodsList'

    # 发送请求
    def getGoodsList_action(self, category_id, kwd, sales_sum, price):
        getGoodsList_data = {
            "category_id": category_id,
            "keyword": kwd,
            "sales_sum": sales_sum,
            "price": price
        }
        getGoodsList = self.meeting.get(url=self.hosturl+self.path, params=getGoodsList_data)
        return getGoodsList.json()


# if __name__ == '__main__':
#     import requests
#
#     s = requests.session()
#     shop_list = getGoodsList_model(meeting=s)
#     msg = shop_list.getGoodsList_action(category_id='', kwd='铅笔', sales_sum='desc', price='desc')
#     print(msg)
#     commodity_id = msg["data"]["list"][0]["id"]
#     print(commodity_id)
#     hd = {"id": commodity_id}
